home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / os2 / pc2_140.zip / SOURCE.ZIP / Source / Error.h < prev    next >
Text File  |  1993-03-09  |  5KB  |  76 lines

  1. /***********************************************************************\
  2.  *                               Error.h                               *
  3.  *                 Copyright (C) by Stangl Roman, 1992                 *
  4.  * This Code may be freely distributed, provided the Copyright isn't   *
  5.  * removed.                                                            *
  6.  *                                                                     *
  7.  * Requires: Error.c    The routing General_Error                      *
  8.  *           Error.h    The include-file that defines the macros       *
  9.  *                      GEN_ERR, DOS_ERR, USR_ERR                      *
  10.  *                                                                     *
  11.  * Error is a general errorhandler for OS/2 2.0 PM programmer to easy  *
  12.  * program development. The routine General_Error displays:            *
  13.  *      ErrModule       The module containing the error                *
  14.  *      ErrLine         The sourcecode line, that contains the error   *
  15.  *      Error           The error returned by an OS/2 API              *
  16.  * The routine requires the following parameters passed:               *
  17.  *      HAB hab         The anchor block handle                        *
  18.  *      HWND hwndFrame  The windowhandle of the frame window           *
  19.  *      HWND hwndClient The windowhandle of the client window          *
  20.  *      PSZ ErrModule   The pointer to the name of the module _FILE_   *
  21.  *      LONG ErrLine    The pointer to the sourcecodeline __LINE__     *
  22.  *                                                                     *
  23.  * This routine displays a message box, with Abort, Retry, Ignore      *
  24.  * buttons. If Abort is selected, and hwndFrame<>NULL, then post a     *
  25.  * WM_QUIT message to hwndFrame, else exit to OS/2 via exit().         *
  26.  *                                                                     *
  27.  * The routine Dos_Error displays:                                     *
  28.  *      ErrModule       The module containing the error                *
  29.  *      ErrLine         The sourcecode line, that contains the error   *
  30.  *      Error           The error returned by an OS/2 API              *
  31.  * The routine requires the following parameters passed:               *
  32.  *      ReturnCode      The returncode of an os/2 API                  *
  33.  *      HWND hwndFrame  The windowhandle of the frame window           *
  34.  *      HWND hwndClient The windowhandle of the client window          *
  35.  *      PSZ ErrModule   The pointer to the name of the module _FILE_   *
  36.  *      LONG ErrLine    The pointer to the sourcecodeline __LINE__     *
  37.  *                                                                     *
  38.  * This routine displays a message box, with Abort, Retry, Ignore      *
  39.  * buttons. If Abort is selected, and hwndFrame<>NULL, then post a     *
  40.  * WM_QUIT message to hwndFrame, else exit to OS/2 via exit().         *
  41.  *                                                                     *
  42.  * The routine User_Error displays:                                    *
  43.  *      ErrModule       The module containing the error                *
  44.  *      ErrLine         The sourcecode line, that contains the error   *
  45.  *      Error           The error indicated by the user                *
  46.  * The routine requires the following parameters passed:               *
  47.  *      PSZ ErrorCode   The errorcode of the user                      *
  48.  *      HWND hwndFrame  The windowhandle of the frame window           *
  49.  *      HWND hwndClient The windowhandle of the client window          *
  50.  *      PSZ ErrModule   The pointer to the name of the module _FILE_   *
  51.  *      LONG ErrLine    The pointer to the sourcecodeline __LINE__     *
  52.  *                                                                     *
  53.  * This routine displays a message box, with Abort, Retry, Ignore      *
  54.  * buttons. If Abort is selected, and hwndFrame<>NULL, then post a     *
  55.  * WM_QUIT message to hwndFrame, else exit to OS/2 via exit().         *
  56.  *                                                                     *
  57. \***********************************************************************/
  58.  
  59. #define         INCL_WIN
  60. #define         INCL_DOSMISC
  61.  
  62. #include        <os2.h>
  63. #include        <stdio.h>
  64. #include        <stdlib.h>
  65. #include        <string.h>
  66.  
  67. #define         GEN_ERR_MSGBOXID 65000  /* This number should'nt occur in any other program */
  68. #define         GEN_ERR(x,y,z) General_Error(x,y,z,_FILE_,__LINE__)
  69. #define         DOS_ERR(x,y,z) Dos_Error(x,y,z,_FILE_,__LINE__)
  70. #define         USR_ERR(x,y,z) User_Error(x,y,z,_FILE_,__LINE__)
  71.  
  72. extern void General_Error(HAB hab,HWND hwndFrame,HWND hwndClient,PSZ ErrModule,LONG ErrLine);
  73. extern void Dos_Error(ULONG Error,HWND hwndFrame,HWND hwndClient,PSZ ErrModule,LONG ErrLine);
  74. extern void User_Error(PSZ Error,HWND hwndFrame,HWND hwndClient,PSZ ErrModule,LONG ErrLine);
  75.  
  76.